#coding=utf-8
from django.shortcuts import render
from models import *
from django.db.models import Max,F,Q


# Create your views here.
def index(request):
    # list=BookInfo.books1.filter(heroinfo__hcontent__contains='八')
    # list = BookInfo.books1.filter(pk__lte=3)
    # list=BookInfo.books1.aggregate(Max('id'))
    # list=BookInfo.books1.filter(bread__gt=F('bcommet'))
    list=BookInfo.books1.filter(Q(pk__lt=4) | Q(btitle__contains='1'))
    context={'list1':list}
    print list
    return render(request,'booktest/index.html',context)
